Skip to content

feat: Add conditions to Dashboard filters; Support filter multi-select#1969

Open
pulpdrew wants to merge 1 commit intomainfrom
drew/dashboard-filter-where
Open

feat: Add conditions to Dashboard filters; Support filter multi-select#1969
pulpdrew wants to merge 1 commit intomainfrom
drew/dashboard-filter-where

Conversation

@pulpdrew
Copy link
Contributor

Summary

This PR improves dashboard filters

  1. Dashboard filters can now have an associated WHERE condition which filters the rows from which filter values will be queried.
  2. Multiple values can now be selected for a single dashboard filter

Screenshots or video

Multiple values can now be selected for a single filters:

Screenshot 2026-03-23 at 12 31 02 PM

Filters now have an optional condition, which filters the values which show up in the dropdown:

Screenshot 2026-03-23 at 12 30 44 PM Screenshot 2026-03-23 at 12 30 54 PM

This also applies to Preset Dashboard Filters

Screenshot 2026-03-23 at 12 33 34 PM

How to test locally or on Vercel

This can be partially tested in the preview environment, but testing the following requires running locally

  1. Preset dashboard filters
  2. External API support

References

  • Linear Issue: Closes HDX-3631 Closes HDX-2987
  • Related PRs:

@changeset-bot
Copy link

changeset-bot bot commented Mar 23, 2026

🦋 Changeset detected

Latest commit: 20e69f3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@hyperdx/common-utils Patch
@hyperdx/api Patch
@hyperdx/app Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Mar 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview, Comment Mar 23, 2026 4:49pm

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

Knip - Unused Code Analysis

0 change in total issues (240 on main → 240 on PR)

Category main PR Diff
Unused files 9 9 0
Unused dependencies 14 14 0
Unused devDependencies 20 20 0
Unlisted dependencies 14 14 0
Unresolved imports 2 2 0
Unlisted binaries 2 2 0
Unused exports 132 132 0
Unused exported types 41 41 0
Unused enum members 2 2 0
Duplicate exports 4 4 0
What is this?

Knip finds unused files, dependencies, and exports in your codebase.
This comment compares the PR branch against main to detect regressions.

Run yarn knip locally to see full details.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

PR Review

✅ No critical issues found.

A few minor observations:

  • ⚠️ calls[resultIndex] accessed without null guard in useDashboardFilterValues.tsx:217 — In practice useQueries keeps results.length === calls.length, so this is safe, but call.filterIds?.[keyIndex] uses optional chaining while call itself does not. Low risk, but worth noting.

  • ⚠️ sourceMetricType null vs undefined in key generationfilterToKey in useDashboardFilterValues.tsx:33 uses JSON.stringify with metricType: filter.sourceMetricType. If the API returns null (from MongoDB) but UI omits the field (undefined), the JSON keys will differ ({"metricType":null} vs {"metricType" omitted), potentially preventing filters from being grouped together. Consider metricType: filter.sourceMetricType ?? undefined.

  • ℹ️ isLoading vacuous truthresults.every(r => r.isLoading) returns true when results is empty (no filters/calls). This is covered by isLoadingOptimizedCalls in practice, but the semantics are slightly misleading.

The multi-select and WHERE condition features are well-implemented with solid test coverage (unit + integration + e2e). The filter ID-based keying to distinguish filters with the same expression but different WHERE clauses is a clean architectural decision.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

E2E Test Results

All tests passed • 92 passed • 3 skipped • 935s

Status Count
✅ Passed 92
❌ Failed 0
⚠️ Flaky 1
⏭️ Skipped 3

Tests ran across 4 shards in parallel.

View full report →

@pulpdrew pulpdrew force-pushed the drew/dashboard-filter-where branch from c6872fe to 20e69f3 Compare March 23, 2026 16:46
@pulpdrew pulpdrew requested review from a team and karl-power and removed request for a team March 23, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant